#include<bits/stdc++.h>
using namespace std;
int n,x,A,B;
vector<int> v[100011];
int a[100011],m;
void pullout(int p)
{
	a[++m] = p;
	for(auto i:v[p]) if(i != a[m - 1])
		return pullout(i);
}
void Runl()
{
	pullout(x);
	int l = A + 1,r = A + 1,res = n;
	if(l > n)
		l = r = 1;
	for(int i = 1;i <= n;i++)
	{
		if(l + A <= n && l + A - B <= i)
			l += A,r += A + B;
		// cerr << l << ' ' << r << "\n";
		if(l - B <= i && ((i < r || (i <= r + B && i + A > n)) || (i > r + B && r + B + A > n && i <= r + B + B)))
			res = min(res,a[i]);
	}
	cout << res << "\n";
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("nim.in","r",stdin);
	freopen("nim.out","w",stdout);
	cin >> n >> x >> A >> B;
	if(A <= B)
	{
		cout << 1;
		return 0;
	}
	for(int i = 1;i < n;i++)
	{
		int a,b;
		cin >> a >> b;
		v[a].push_back(b),v[b].push_back(a);
	}
	bool flag = (v[x].size() == 1);
	for(int i = 1;i <= n;i++) flag &= (v[i].size() <= 2);
	if(flag)
	{
		Runl();
		return 0;
	}
	return 0;
}